package com.bugk.aop;

import org.springframework.beans.BeansException;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.scheduling.annotation.Async;

import javax.annotation.PostConstruct;

public class CglibProxyDemo implements InitializingBean, ApplicationContextAware {

	ApplicationContext applicationContext;

	public void CglibProxyDemoMethod(){
		System.out.println("CglibProxyDemo.CglibProxyDemoMethod invoked...");
	}

	@Override
	public void afterPropertiesSet() throws Exception {

	}

	@Override
	public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
		this.applicationContext = applicationContext;
	}

	@PostConstruct
	public void postConstruct() {
		System.out.println("@PostConstruct execute...");
	}

	@Async
	public void asyncMethod(){
		System.out.println("asyncMethod execute...");
	}

	public void initMethod(){
		System.out.println("initMethod execute...");
	}
}
